package com.example.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author 游家纨绔
 * @Description TODO 返回值包装类
 * @Create 2023-08-30 12:20
 */
@Data
@NoArgsConstructor
public class ResponseVO {

	private Integer code;
	private Object data;
	private String message;

	public ResponseVO(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public ResponseVO(Integer code, Object data, String message) {
		this.code = code;
		this.data = data;
		this.message = message;
	}

	public static ResponseVO success(Integer code, String message) {
		return new ResponseVO(code, message);
	}

	public static ResponseVO success(Integer code, Object data, String message) {
		return new ResponseVO(code, data, message);
	}

	public static ResponseVO fail(Integer code, String message) {
		return new ResponseVO(code, message);
	}

	public static ResponseVO fail(Integer code, Object data, String message) {
		return new ResponseVO(code, data, message);
	}

}
